package com.ruoyi.app.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.park.domain.HousePark;
import com.ruoyi.park.service.IHouseParkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 园区表Controller
 * 
 * @author hct
 * @date 2022-02-16
 */
@RestController
@RequestMapping("/app/public/park")
public class AppParkController extends BaseController
{
    @Autowired
    private IHouseParkService houseParkService;

    /**
     * 查询园区表列表
     */
    @GetMapping("/list")
    public TableDataInfo list(HousePark housePark)
    {
        startPage();
        List<HousePark> list = houseParkService.selectHouseParkList(housePark);
        return getDataTable(list);
    }


    /**
     * 获取园区表详细信息
     */
    @GetMapping(value = "/detail/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(houseParkService.selectHouseParkById(id));
    }
}
